var mongoose=require('mongoose');
var moment=require('moment');
var ScoreSchema=new mongoose.Schema(
	{
		levelid:{
			type:Number
		},
		jpScore:{
			type:Number
		},
		
	}
	);

ScoreSchema.pre('save',function(next){
	console.log('保存成功');
	next();});

ScoreSchema.statics={
	fetch:function(cb){
		return this.find({}).sort('').exec(cb);
	},
	findById:function(id,cb){
		return this.find({_id:id}).sort('').exec(cb);
	}
}

module.exports=ScoreSchema;